<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            display: flex;
            width: 500px;
            height: 500px;
            background-color: red;
            justify-content: center;
            align-items: center;
            perspective: 1000px;
            

        }

        .rail {
            /*  margin: auto; */
            position: relative;
            width: 200px;
            height: 200px;
            border: 2px solid blue;
            transform-style: preserve-3d;
            /*transform: scaleY(0.5) rotateZ(45deg);*/
          
            animation: rail_rotate 20s linear infinite;
             border-radius: 50%; 


        }
@keyframes rail_rotate {
    0%{
        transform: rotate(45deg) scaleY(0.5) rotate(0);
    }
    100%{
        transform: rotate(45deg) scaleY(0.5) rotate(360deg);
    }
    
}
        .planet {
            position: absolute;
            top: -25px;
            left:calc(50% - 25px);
            width: 50px;
            height: 50px;
            background-color: yellow;
            border-radius: 50%;
            /*transform:rotate(-45deg) scaleY(2);*/
            animation: planet_rotate 20s linear infinite;
        }
        @keyframes planet_rotate {
    0%{
        transform:  rotateZ(0) scaleY(2) rotate(-45deg);
    }
    100%{
        transform:  rotateZ(-360deg) scaleY(2) rotate(-45deg);
    }
    
}
    </style>
</head>

<body>
    <div class="box">
        <div class="rail">
            <div class="planet"></div>
        </div>
    </div>
</body>

</html>